﻿<phone:PhoneApplicationPage 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone" 
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone" 
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:c4fToolkitBinding="clr-namespace:Coding4Fun.Phone.Controls.Binding;assembly=Coding4Fun.Phone.Controls" 
    xmlns:sltoolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit" 
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:AmCharts_Windows_QuickCharts="clr-namespace:AmCharts.Windows.QuickCharts;assembly=AmCharts.Windows.QuickCharts.WP" 
    xmlns:Coding4Fun_Phone_Controls="clr-namespace:Coding4Fun.Phone.Controls;assembly=Coding4Fun.Phone.Controls" 
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" 
    xmlns:ec="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions" 
    
    x:Class="ShoppingList.MainPage"
	 toolkit:TiltEffect.IsTiltEnabled="True"
    d:DesignWidth="480" d:DesignHeight="800"
    
    SupportedOrientations="Portrait"  Orientation="Portrait"
    shell:SystemTray.IsVisible="False" mc:Ignorable="d">
	<phone:PhoneApplicationPage.Resources>
		<DataTemplate x:Key="DataTemplate1">
			<Grid Height="39" Width="412">
				<TextBlock HorizontalAlignment="Left" Margin="0,0,0,12" TextWrapping="Wrap" Text="{Binding StringDate, Mode=TwoWay}" d:LayoutOverrides="Height" Style="{StaticResource PhoneTextSmallStyle}" Foreground="{StaticResource PhoneForegroundBrush}"/>
				<TextBlock HorizontalAlignment="Right" Margin="0,0,0,12" TextWrapping="Wrap" Text="{Binding result, Mode=TwoWay}" d:LayoutOverrides="Height" Style="{StaticResource PhoneTextSubtleStyle}" Foreground="{StaticResource PhoneForegroundBrush}" FontFamily="Segoe WP Semibold"/>
			</Grid>
		</DataTemplate>
		<Style x:Key="TileStyle1" TargetType="Coding4Fun_Phone_Controls:Tile">
			<Setter Property="Background" Value="{StaticResource PhoneAccentBrush}"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="Coding4Fun_Phone_Controls:Tile">
						<Grid Background="{TemplateBinding Background}">
							<ContentPresenter 
								Content="{TemplateBinding Content}" />
							<TextBlock
								TextWrapping="{TemplateBinding TextWrapping}"
								VerticalAlignment="Top"
								Padding="12, 0"
								Text="{TemplateBinding Title}" FontSize="34.667" />
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<DataTemplate x:Key="DataTemplate2">
			<Grid Height="54" Margin="3,0,2,0">
				<Border BorderThickness="1" BorderBrush="{StaticResource PhoneBorderBrush}" Background="{StaticResource PhoneAccentBrush}">
					<Grid>
						<TextBlock Margin="8,0,44,0" TextWrapping="Wrap" Text="Califica Shopping Analytics" VerticalAlignment="Center" FontFamily="Segoe WP" FontSize="18.667" Foreground="{StaticResource ForegroundBrush}"/>
						<Image HorizontalAlignment="Right" Width="44" Source="/icons/appbar.next.rest.png"/>
					</Grid>
				</Border>
			</Grid>
		</DataTemplate>
	</phone:PhoneApplicationPage.Resources>


	<phone:PhoneApplicationPage.FontFamily>
		<StaticResource ResourceKey="PhoneFontFamilyNormal"/>
	</phone:PhoneApplicationPage.FontFamily>
	<phone:PhoneApplicationPage.FontSize>
		<StaticResource ResourceKey="PhoneFontSizeNormal"/>
	</phone:PhoneApplicationPage.FontSize>
	<phone:PhoneApplicationPage.Foreground>
		<StaticResource ResourceKey="PhoneForegroundBrush"/>
	</phone:PhoneApplicationPage.Foreground>


    <toolkit:TransitionService.NavigationInTransition>
        <toolkit:NavigationInTransition>
            <toolkit:NavigationInTransition.Backward>
                <toolkit:TurnstileTransition Mode="BackwardIn" />
            </toolkit:NavigationInTransition.Backward>
            <toolkit:NavigationInTransition.Forward>
                <toolkit:TurnstileTransition Mode="ForwardIn"/>
            </toolkit:NavigationInTransition.Forward>
        </toolkit:NavigationInTransition>
    </toolkit:TransitionService.NavigationInTransition>
    <toolkit:TransitionService.NavigationOutTransition>
        <toolkit:NavigationOutTransition>
            <toolkit:NavigationOutTransition.Backward>
                <toolkit:TurnstileTransition Mode="BackwardOut"/>
            </toolkit:NavigationOutTransition.Backward>
            <toolkit:NavigationOutTransition.Forward>
                <toolkit:TurnstileTransition Mode="ForwardOut"/>
            </toolkit:NavigationOutTransition.Forward>
        </toolkit:NavigationOutTransition>
    </toolkit:TransitionService.NavigationOutTransition>


    <!--Panorama-based applications should not show an ApplicationBar--><!--LayoutRoot contains the root grid where all other page content is placed-->
    <Grid x:Name="LayoutRoot" DataContext="{Binding Source={StaticResource Locator}}">
        <controls:Panorama x:Name="panorama" Title="shopping analytics">
            <!--Panorama item one-->
            <controls:PanoramaItem Header="inicio" DataContext="{Binding Main, Mode=OneWay}" Foreground="{StaticResource PhoneSubtleBrush}">
                <Grid>
                	<ListBox ItemsPanel="{StaticResource ListBoxHubTilePanel}" ItemTemplate="{StaticResource ListboxDataTemplateHubTile}" ItemsSource="{Binding tileItems, Mode=TwoWay}" Height="180" VerticalAlignment="Top"/>
                	<Coding4Fun_Phone_Controls:Tile 
                        HorizontalAlignment="Left"
                        Margin="0,184,0,141"
                        Width="358"
                        Height="173"
                        c4fToolkitBinding:FrameworkElementBinding.ClipToBounds="True"
                        Title="estadísticas" Style="{StaticResource TileStyle1}" Foreground="{StaticResource ForegroundBrush}">
                		<i:Interaction.Triggers>
                			<i:EventTrigger EventName="Click">
                				<ec:NavigateToPageAction TargetPage="/Views/StatisticsView.xaml"/>
                			</i:EventTrigger>
                		</i:Interaction.Triggers>
                        <Grid>
                            <Canvas>
                            	<Border Height="173" Width="358" BorderBrush="White" BorderThickness="1">
                            		<Image 
                            			x:Name="image" 
                            			Source="/Images/charts.png">
                            			<Image.RenderTransform>
                            				<CompositeTransform />
                            			</Image.RenderTransform>
                            		</Image>
                            	</Border>
                            </Canvas>
                        </Grid>
                    </Coding4Fun_Phone_Controls:Tile>
                </Grid>
            </controls:PanoramaItem>

            <!--Panorama item two-->
            <controls:PanoramaItem Header="esta semana..." DataContext="{Binding ViewModelStatistics, Mode=OneWay}" Foreground="{StaticResource PhoneSubtleBrush}">
                <Grid>
                	<Grid.RowDefinitions>
                		<RowDefinition Height="0.677*"/>
                		<RowDefinition Height="0.323*"/>
                	</Grid.RowDefinitions>
                	<AmCharts_Windows_QuickCharts:SerialChart x:Name="serialChart" d:LayoutOverrides="Width, Height" DataSource="{Binding MyValueItems, Mode=TwoWay}" 
                		CategoryValueMemberPath="StringDate" 
                		AxisForeground="{StaticResource PhoneForegroundBrush}"
                		PlotAreaBackground="{x:Null}"
                		GridStroke="{StaticResource PhoneTextBoxReadOnlyBrush}" LegendVisibility="Collapsed" Foreground="{StaticResource PhoneForegroundBrush}" >
                		<AmCharts_Windows_QuickCharts:SerialChart.Graphs>
                			<AmCharts_Windows_QuickCharts:ColumnGraph Title="Esta semana." ValueMemberPath="result" Brush="{StaticResource PhoneAccentBrush}"/>
                		</AmCharts_Windows_QuickCharts:SerialChart.Graphs>
                		
						           	
                	</AmCharts_Windows_QuickCharts:SerialChart>
                	<ListBox Grid.Row="1" ItemsSource="{Binding DataSource, ElementName=serialChart, Mode=TwoWay}" ItemTemplate="{StaticResource DataTemplate1}"/>
                </Grid>
            </controls:PanoramaItem>
            <controls:PanoramaItem Header="acerca de..." Foreground="{StaticResource PhoneSubtleBrush}">
            	<Grid>
            		<Grid.RowDefinitions>
            			<RowDefinition Height="0.313*"/>
            			<RowDefinition Height="0.355*"/>
            			<RowDefinition Height="0.331*"/>
            		</Grid.RowDefinitions>
            		<Grid Margin="8,8,8,62" Grid.RowSpan="2" Background="{StaticResource PhoneSemitransparentBrush}">
            			<TextBlock TextWrapping="Wrap" FontFamily="Segoe WP" Margin="0,0,0,125" Foreground="{StaticResource PhoneForegroundBrush}"><Run Text="Shopping "/><Run Text="Analytics ha sido desarrollado  con la finalidad de brindar un control preciso sobre los gastos que comúnmente realizamos cada día.       Espero que esta aplicación realmente sea útil para este propósito."/></TextBlock>
            			<TextBlock TextWrapping="Wrap" 
            				Text="Si has disfrutado o te ha resultado útil esta aplicación, por favor tomate 2 segundos de tu tiempo y  califica a Shopping Analytics muchas gracias! ." FontFamily="Segoe WP" VerticalAlignment="Bottom" Foreground="{StaticResource PhoneForegroundBrush}"/>
            		</Grid>
            		<Coding4Fun_Phone_Controls:Tile x:Name="btnAbout" Content="Califica a Ex-Analytics" Margin="8,118,8,0" Grid.Row="1" VerticalAlignment="Top" HorizontalAlignment="Center" ContentTemplate="{StaticResource DataTemplate2}" BorderThickness="3" Width="294" Background="{x:Null}"/>
            	</Grid>
            </controls:PanoramaItem>
        </controls:Panorama>
    </Grid>

</phone:PhoneApplicationPage>